<?php
namespace app\admin\validate;


class GoodsCateValidate extends BaseValidate
{

    public function __construct()
    {
        $rule = [
            'name' => 'require|max:100',
            'pid'  => 'require|number',
        ];

        $message = [
            'name.require' => '请输入分类名称',
            'name.max'     => '分类名称最多不能超过100个字符',
            'pid.require'  => '请选择上级分类',
            'pid.number'   => 'pid类型不正确',
        ];

        $scene = [
            'add' => ['name'],
        ];
        parent::__construct($rule, $message, $scene);
    }
}